<template>
    <div>
        <h2>C组件</h2>
        <input type="text">
        <button @click="changA"> 到A组件</button>
    </div>
</template>
<script>
   export default {
        name:'Ccom',
        methods: {
            changA(){
                this.$router.push("/A")
            },
        },
        //组件内的三个路由钩子
        beforeRouteLeave(to,from,next){
            to.meta.keepAlive=false;
            next();
        },
        // beforeRouteEnter(){

        // },
        // beforeRouteUpdate(){

        // },
        
   };
</script>
<style scoped>

</style>